package com.waijiaojun.tpo.repository;

import com.waijiaojun.tpo.entity.QuestionCategoryRef;
import com.waijiaojun.tpo.vo.ExecQuestionVo;
import com.waijiaojun.tpo.vo.QuestionAndUserAnswerVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import com.waijiaojun.tpo.entity.Question;
import org.springframework.stereotype.Component;

@Component
@Mapper
public interface QuestionDao {
    int insert(@Param("pojo") Question pojo);

    int insertSelective(@Param("pojo") Question pojo);

    int insertList(@Param("pojos") List<Question> pojo);

    int update(@Param("pojo") Question pojo);

    List<QuestionAndUserAnswerVo> findWithUserAnswerByScenarioId(@Param("scenarioId")Long scenarioId,@Param("openid")String openid);

    List<Question> findByScenarioId(Long scenarioId);

    void delete(@Param("id")Long id);

    void updateNumberForDelete(@Param("scenario_id")Long scenario_id,@Param("number")Long number);

    Question findById(@Param("id")Long id);

    List<QuestionCategoryRef> findCategoryRefsByQuestionIds(@Param("pojos")List<Question> list);

    void updateQuestionCategory(@Param("pojos")List<Long> cateIds, @Param("questionId")Long questionId);

    void deleteQuestionCategory(@Param("questionId")Long questionId);
}
